﻿using System.Collections.Generic;
using System.Web.Mvc;

namespace Genesis.Infrastructure.Web.Extensions
{

    public static class ViewDataDictionaryExtensions
    {

        public static void SetSelectList(this ViewDataDictionary viewData, string key, IEnumerable<SelectListItem> items)
        {

            viewData["SelectList:" + key] = items;

        }

        public static IEnumerable<SelectListItem> GetSelectList(this ViewDataDictionary viewData, string key)
        {

            return viewData["SelectList:" + key] as IEnumerable<SelectListItem>;

        }

    }

}